/*
package com.springboot.mall.config;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//@Component
public class LoginInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        Object loginUser = request.getSession().getAttribute("loginUser");
        if (loginUser == null){
            //未登录，返回登录页
            request.setAttribute("msg","您没有权限进行此操作，请先登录！！！");
            request.getRequestDispatcher("/backend/page/login/index.html").forward(request,response);
        }
        return true;
    }
}
*/
